package actionScripts.common
{
	import actionScripts.AdminSetupModelLocator;
	import mx.collections.ArrayCollection;
	import mx.managers.CursorManager;

	[Bindable]
	public class ClsGlobal
	{
		//-------------------
		//	PRIVATE VARIABLES
		//-------------------
		private static var appModelLocator	: AdminSetupModelLocator = AdminSetupModelLocator.getInstance();
		
		//-------------------
		//	PUBLIC VARIABLES
		//-------------------
		// these variable helps in showing data trasferring/updating thing
		public static var isStageLayer				: Boolean;	// put a layer over the stage, so that user cant make a fresh request unless first commits
		public static var isUpdating				: Boolean;
		public static var isTransferring			: Boolean;
		public static var userPvtPermissionAC		: ArrayCollection = new ArrayCollection();
		public static var userSecurityLevel			: Number = 0;
		public static var systemConfigurationXML	: XML;
		public static var browseSetDefination		: XML;
		public static var gscConfigComponentXML		: XML;
		
		public static var publicIP					: String;	// holds public ip address, it can be accessed from sub apps also when integrated
		public static var currentAppName			: String;	// keeps current application name
		
		/* CONSTRUCTOR */
		public function ClsGlobal()	{
		}
		
		//---------------------
		// METHODS
		//---------------------
		public static function showLoader( _isStageLayer:Boolean, _isTransferring:Boolean, _isUpdating:Boolean ) : void {
			
			// removing the loader and layer on the screen //
			CursorManager.setBusyCursor();
			isStageLayer		= _isStageLayer;
			isTransferring 		= _isTransferring;
			isUpdating 			= _isUpdating;
			
		}
		
		public static function removeLoader() : void {
			
			isStageLayer		= false;
			isTransferring 		= false;
			isUpdating 			= false;
			CursorManager.removeBusyCursor();
			
		}
		
	}
}